package handler

import (
	"github.com/gin-gonic/gin"
	"month/api/request"
	"month/consts"
	"month/internal/queue"
)

func AnyChat(c *gin.Context) {
	var req request.AnyChatReq
	if err := c.ShouldBind(&req); err != nil {
		c.JSON(200, gin.H{
			"code": 500,
			"msg":  "查询失败",
			"data": err.Error(),
		})
		return
	}

	queue.PublishPub(consts.Notification, req.Message)

	c.JSON(200, gin.H{
		"code": 200,
		"msg":  "发送成功",
		"data": true,
	})

}
